#define _CRT_SECURE_NO_WARNINGS 1

#include"Slist.h"

void Test1()
{
	ListNode* plist = ListCreate();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	ListPushFront(plist, 10);
	ListPushFront(plist, 20);
	ListPushFront(plist, 30);
	ListPushFront(plist, 40);
	ListPrint(plist);
	ListDestory(plist);
	plist = NULL;


}
void Test2()
{
	ListNode* plist = ListCreate();
	ListPushBack(plist, 1);
	ListPushBack(plist, 2);
	ListPushBack(plist, 3);
	ListPushBack(plist, 4);
	ListPrint(plist);
	ListPopBack(plist);
	ListPrint(plist);
	ListPopFront(plist);
	ListPrint(plist);
	ListNode* pos = ListFind(plist, 3);
	if (pos != NULL)
	{
		ListInsert(pos, 300);
		ListPrint(plist);
	}
	pos = ListFind(plist, 300);
	if (pos != NULL)
	{
		ListErase(pos);
		ListPrint(plist);
	}
	ListDestory(plist);
	plist = NULL;
	

}


int main()
{
	//Test1();
	Test2();

	return 0;
}